<?php

  $NEWS_ID = is_array($_REQUEST["del_id"]) ? implode("," , $_REQUEST["del_id"]) : (int)$_REQUEST["del_id"];
  if (empty($NEWS_ID)) exit(0);  
 
//删除文章里的圖片
	
  $query_pic="select * FROM $TBL_PIC WHERE NEW_ID in ($NEWS_ID)"; 
  $result = mysql_query($query_pic);
  while($row = @mysql_fetch_array($result))
  {
	$new_id = $row['NEW_ID'];
	$IMG_NAME = $row['IMG_NAME'];
	@unlink($conf['fck_upload']."news/".$new_id."/".$IMG_NAME); 
  }
  mysql_query("delete from $TBL_PIC WHERE NEW_ID in ($NEWS_ID)");  
    
/** 
 * 删除该文章
 */
  $query = "DELETE FROM $TBL_NEWS WHERE id IN ($NEWS_ID)";
  $res = mysql_query($query) or die(mysql_error());
  if (! $res)
  {
    MyNotice("删除失败,请与管理员联系",2,"news.php");
    exit(0);
  }
 
  MyNotice("活動已成功删除!",2,"news.php");  
  exit(0);
?>
